<!-- // Form validation code will come here -->

<script type="text/javascript">
 function validateEmail()
{
 
   var emailID = document.MyForm.mail.value;
   atpos = emailID.indexOf("@");
   dotpos = emailID.lastIndexOf(".");
   if (atpos < 1 || ( dotpos - atpos < 2 )) 
   {
       alert("Please enter correct email ID")
       document.MyForm.mail.focus() ;
       return false;
   }
   return( true );
}
 
 
 function validate()
 {
 if( document.MyForm.name.value == "" ) { 
 alert( "Please provide your name!" );
 document.MyForm.name.focus() ; 
 return false; 
 }
 if( document.MyForm.password.value == "" ) { 
 alert( "Please provide your password!" );
 document.MyForm.password.focus() ; 
 return false; 
 } 
 
 if( document.MyForm.mail.value == "" )
   {
     alert( "Please provide your Email!" );
     document.MyForm.mail.focus() ;
     return false;
   }else{
     // Put extra check for data format
     var ret = validateEmail();
     if( ret == false )
     {
          return false;
     }
   }
 
 
 if( document.MyForm.Phone_Number.value == "" || isNaN(document.MyForm.Phone_Number.value )  ) {
 
 alert( "Please provide a age in the format of number." ); 
 document.MyForm.Phone_Number.focus() ;
 return false; }
 
 return( true );
 } //--> </script>

 
                <!--  This is a content of the page that will be changed with the choices --> 

  <div id="templatemo_content_right">
  
  
                             <div style="float:left;width:100%;height:445px;" >
                             <img width="100%" src="images/Registration.jpg">
							
                             <form name="MyForm" action="do_registration.php" method="post" onsubmit="return(validate());">
                             <font face="vendra" size="3" color="#680036" method="post">

                             <table cellspacing="10" width="100%">
							 <tr >
							 <td colspan="3"><h1> Please Fill all the fields to Register</h1></td>
                             </tr>
                             <tr>
							 <td style="color:red;">*</td><td>UserName</td> <td><input type="text" name="name"/></td>
                             </tr>
                             <tr>
                             <td style="color:red;">*</td><td>Password</td><td><input type="password" name="password"/> </td>
                             </tr>

                             <tr>
                             <td style="color:red;">*</td><td>Mail</td><td><input type="mail" name="mail"/> </td>
                             </tr>

                             <tr>
                             <td style="color:red;">*</td><td>Phone_Number</td><td><input type="age" name="Phone_Number"/> </td>
                             </tr>

                             <tr>

                             <td colspan="3" align="center">
							 <br/>
							 <input type="submit" style="background-color:#023014;color:white;width:100px;" value="Register" />
							 &nbsp;
							 <input type="reset"  style="background-color:#023014;color:white;width:100px;" value="Reset"    />
                             </td>
							 </tr>
							 <tr>
							 <td>
							 * means the field shouldn't be empty .
							 <td>
							 </tr>
                             </table>
                             </form>
							 
							         </div> <!-- end of content right -->
